package com.xhui.vimarket.zkplus.zul.attr.bean.impl;

import java.util.List;
import java.util.Map;

import lombok.Getter;
import lombok.Setter;

import com.xhui.crm.common.vo.NodeVo;com.xhui.vimarket.zkplusui.vimarket.zkplus.zul.attr.bean.AttrTmpl;

/**
 * AttrTmplImpl.
 * 
 * @版权：福富软件 版权所有 (c) 2011
 * @author wuyx
 * @version Revision 1.0.0
 * @see:
 * @创建日期：2011-1-23
 * @功能说明：
 * 
 */
public class AttrTmplImpl implements AttrTmpl {
    
    /**
     * 容器.
     */
    public static final String        MODE_BOX                 = "box";
    
    /**
     * Div容器.
     */
    public static final String        MODE_DIV                 = "div";
    /**
     * warper.
     */
    public static final String        MODE_WARPER              = "warper";
    /**
     * warper.
     */
    public static final String        MODE_BATCHWARPER         = "batchwarper";
    /**
     * layout.
     */
    public static final String        MODE_LAYOUT              = "layout";
    /**
     * grid.
     */
    public static final String        MODE_GRID                = "grid";
    /**
     * panel.
     */
    public static final String        MODE_PANEL               = "panel";
    /**
     * panel.
     */
    public static final String        MODE_PANELGRID           = "panelgrid";
    /**
     * label.
     */
    public static final String        MODE_LABEL               = "label";
    /**
     * text.
     */
    public static final String        MODE_TEXT                = "text";
    /**
     * text.
     */
    public static final String        MODE_TEXT_INFO           = "textinfo";
    /**
     * text.
     */
    public static final String        MODE_BUTTONTEXT          = "buttontext";
    /**
     * text.
     */
    public static final String        MODE_MENUTEXT            = "menutext";
    /**
     * int.
     */
    public static final String        MODE_INT                 = "int";
    /**
     * long.
     */
    public static final String        MODE_DOUBLE              = "double";
    /**
     * long.
     */
    public static final String        MODE_MONEY               = "money";
    /**
     * password.
     */
    public static final String        MODE_PASSWORD            = "password";
    /**
     * MODE_PASSWORDTWO.
     */
    public static final String        MODE_PASSWORDTWO         = "passwordtwo";
    /**
     * selectlist.
     */
    public static final String        MODE_SELECTLIST          = "selectlist";
    /**
     * selectlist.
     */
    public static final String        MODE_MULTI_CHECKBOX      = "multicheckbox";
    /**
     * combo.
     */
    public static final String        MODE_COMBOBOX            = "combo";
    /**
     * band.
     */
    public static final String        MODE_BANDBOX             = "band";
    /**
     * radio.
     */
    public static final String        MODE_RADIO               = "radio";
    /**
     * checkbox.
     */
    public static final String        MODE_CHECKBOX            = "checkbox";
    /**
     * selectlist.
     */
    public static final String        MODE_CHECKBOX_BYINST     = "checkboxbyinst";
    /**
     * date.
     */
    public static final String        MODE_DATE                = "date";
    /**
     * datetime.
     */
    public static final String        MODE_DATETIME            = "datetime";
    /**
     * time.
     */
    public static final String        MODE_TIME                = "time";
    /**
     * mulitsub.
     */
    public static final String        MODE_MULTISUB            = "multisub";
    /**
     * treetab.
     */
    public static final String        MODE_TREETAB             = "treetab";
    /**
     * treetab.
     */
    public static final String        MODE_TABBOX              = "tabbox";
    /**
     * treetab.
     */
    public static final String        MODE_TABCONTENT          = "tabcontent";
    /**
     * treetab.
     */
    public static final String        MODE_TABTBAR             = "tabtbar";
    /**
     * treetab.
     */
    public static final String        MODE_GROUPBOX            = "groupbox";
    /**
     * showSetting.
     */
    public static final String        MODE_SHOWSETTING         = "showset";
    /**
     * null.
     */
    public static final String        MODE_NULL                = "null";
    /**
     * MODE_DIVEXT.
     */
    public static final String        MODE_DIVEXT              = "divext";
    /**
     * STYLE_DEF.
     */
    public static final String        STYLE_DEF                = "def";
    /**
     * MODE_BATCH_OBJECT_ENTITY.
     */
    public static final String        MODE_BATCH_OBJECT_ENTITY = "objentity";
    /**
     * MODE_BATCH_OBJECT_SPEC.
     */
    public static final String        MODE_BATCH_OBJECT_SPEC   = "objspec";
    /**
     * MODE_BATCH_REL_SPEC.
     */
    public static final String        MODE_BATCH_REL_SPEC      = "relspec";
    /**
     * MODE_BATCH_REL_EON.
     */
    public static final String        MODE_BATCH_REL_EON       = "releon";
    /**
     * null.
     */
    public static final String        MODE_NUL                 = "nul";
    /**
     * null.
     */
    public static final String        MODE_NULLVAL             = "nullval";
    
    /**
     * MODE_SELECT_TREE 下拉树状控件.
     */
    public static final String        MODE_SELECTTREE          = "selecttree";
    
    /**
     * MODE_BUS.
     */
    public static final String        MODE_BUS_PROC            = "busproc";
    
    /**
     * MODE_DISCOUNT.
     */
    public static final String        MODE_DISCOUNT            = "discount";
    
    /**
     * idx.
     */
    @Setter
    @Getter
    private long                      idx;
    
    /**
     * 属性规格选取ID.
     */
    @Setter
    @Getter
    private long                      attrInstId;
    
    /**
     * 属性规格ID.
     */
    private long                      attrId;
    
    /**
     * 属性规格码.
     */
    private String                    attrCd;
    
    /**
     * 名称.
     */
    private String                    name;
    
    /**
     * 提示信息.
     */
    private String                    hint;
    
    /**
     * 是否显示.
     */
    private boolean                   isDisplay;
    
    /**
     * 是否只读.
     */
    private boolean                   isReadOnly;
    
    /**
     * 绑定表达.
     */
    private String                    bindExpr;
    
    /**
     * 验证表达.
     */
    private String                    validExpr;
    
    /**
     * 取值类.
     */
    private String                    valueCode;
    
    /**
     * 取值参.
     */
    private String                    valueParam;
    
    /**
     * 取值长.
     */
    private int                       valueLength;
    
    /**
     * 默认.
     */
    private String                    defaultValue;
    
    /**
     * 默认值名.
     */
    private String                    defaultValueName;
    
    /**
     * 起始.
     */
    private String                    valueFrom;
    
    /**
     * 结束.
     */
    private String                    valueTo;
    
    /**
     * 实例最小数量限.
     */
    private String                    minNum;
    
    /**
     * 实例最大数量限.
     */
    private String                    maxNum;
    
    /**
     * X坐标.
     */
    private int                       xAddr;
    
    /**
     * Y坐标.
     */
    private int                       yAddr;
    
    /**
     * 控件类型.
     */
    private String                    displayMode;
    /**
     * .
     */
    @Setter
    @Getter
    private String                    displayStyle;
    /**
     * java编码.
     */
    private String                    javaCode;
    /**
     * 值列表.
     */
    private List<NodeVo>              valueList;
    
    /**
     * .
     */
    @Setter
    @Getter
    private int                       lastIndex;
    
    /**
     * .
     */
    @Setter
    @Getter
    private int                       pageSize;
    
    /**
     * 是否必填.
     */
    @Setter
    @Getter
    private boolean                   cantNull                 = false;
    
    /**
     * 排序.
     */
    @Setter
    @Getter
    private int                       order                    = 0;
    
    /**
     * 占有宽度.
     */
    @Setter
    @Getter
    private int                       width;
    /**
     * 占有高度.
     */
    @Setter
    @Getter
    private int                       height;
    
    /**
     * .
     */
    @Setter
    @Getter
    private String                    param1;
    
    /**
     * .
     */
    @Setter
    @Getter
    private String                    param2;
    
    /**
     * .
     */
    @Setter
    @Getter
    private boolean                   flag;
    
    /**
     * .
     */
    @Setter
    @Getter
    private String                    op;
    
    /**
     * .
     */
    @Setter
    @Getter
    private String                    batchDefValue;
    /**
     * 默认销售品规则ID.
     */
    @Setter
    @Getter
    private long                      defProdOfferId;
    
    /**
     * .
     */
    @Setter
    @Getter
    private String                    componetCode;
    
    /**
     * 属性值Map列表.
     */
    private List<Map<String, Object>> attrValueMapList;
    
    /**
     * 控件模板.
     */
    private List<AttrTmpl>            attrTmplList;
    
    public List<NodeVo> getValueList() {
        return this.valueList;
    }
    
    public void setValueList(final List<NodeVo> valueList) {
        this.valueList = valueList;
    }
    
    public String getJavaCode() {
        return this.javaCode;
    }
    
    public void setJavaCode(final String javaCode) {
        this.javaCode = javaCode;
    }
    
    public long getAttrId() {
        return this.attrId;
    }
    
    public void setAttrId(final long attrId) {
        this.attrId = attrId;
    }
    
    public String getName() {
        return this.name;
    }
    
    public List<AttrTmpl> getAttrTmplList() {
        return this.attrTmplList;
    }
    
    /**
     * 获取属性规格模板数据.
     * @param i int
     * @return AttrTmpl
     */
    public AttrTmpl getAttrTmplList(final int i) {
        if (i < this.getAttrTmplListCount()) {
            return this.attrTmplList.get(i);
        }
        return null;
    }
    
    public void setAttrTmplList(final List<AttrTmpl> attrTmplList) {
        this.attrTmplList = attrTmplList;
    }
    
    public void setName(final String name) {
        this.name = name;
    }
    
    public void setXAddr(final int xAddr) {
        this.xAddr = xAddr;
    }
    
    public void setYAddr(final int yAddr) {
        this.yAddr = yAddr;
    }
    
    public String getDisplayMode() {
        return this.displayMode;
    }
    
    public void setDisplayMode(final String displayMode) {
        this.displayMode = displayMode;
    }
    
    public int getAttrTmplListCount() {
        return this.attrTmplList == null ? 0
            : this.attrTmplList.size();
    }
    
    public String getAttrCd() {
        return this.attrCd;
    }
    
    public void setAttrCd(final String attrCd) {
        this.attrCd = attrCd;
    }
    
    public String getHint() {
        return this.hint;
    }
    
    public void setHint(final String hint) {
        this.hint = hint;
    }
    
    public boolean isDisplay() {
        return this.isDisplay;
    }
    
    /**
     * 设置.
     * @param tisDisplay 是否显示
     */
    public void setDisplay(final boolean tisDisplay) {
        this.isDisplay = tisDisplay;
    }
    
    public boolean isReadOnly() {
        return this.isReadOnly;
    }
    
    /**
     * 设置.
     * @param tisReadOnly 是否只读
     */
    public void setReadOnly(final boolean tisReadOnly) {
        this.isReadOnly = tisReadOnly;
    }
    
    public String getBindExpr() {
        return this.bindExpr;
    }
    
    public void setBindExpr(final String bindExpr) {
        this.bindExpr = bindExpr;
    }
    
    public String getValidExpr() {
        return this.validExpr;
    }
    
    public void setValidExpr(final String validExpr) {
        this.validExpr = validExpr;
    }
    
    public String getValueCode() {
        return this.valueCode;
    }
    
    public void setValueCode(final String valueCode) {
        this.valueCode = valueCode;
    }
    
    public int getValueLength() {
        return this.valueLength;
    }
    
    public void setValueLength(final int valueLength) {
        this.valueLength = valueLength;
    }
    
    public String getDefaultValue() {
        return this.defaultValue;
    }
    
    public void setDefaultValue(final String defaultValue) {
        this.defaultValue = defaultValue;
    }
    
    public String getDefaultValueName() {
        return this.defaultValueName;
    }
    
    public void setDefaultValueName(final String defaultValueName) {
        this.defaultValueName = defaultValueName;
    }
    
    public String getValueFrom() {
        return this.valueFrom;
    }
    
    public void setValueFrom(final String valueFrom) {
        this.valueFrom = valueFrom;
    }
    
    public String getValueTo() {
        return this.valueTo;
    }
    
    public void setValueTo(final String valueTo) {
        this.valueTo = valueTo;
    }
    
    public String getMinNum() {
        return this.minNum;
    }
    
    public void setMinNum(final String minNum) {
        this.minNum = minNum;
    }
    
    public String getMaxNum() {
        return this.maxNum;
    }
    
    public void setMaxNum(final String maxNum) {
        this.maxNum = maxNum;
    }
    
    public int getXAddr() {
        return this.xAddr;
    }
    
    public int getYAddr() {
        return this.yAddr;
    }
    
    /**
     * 设置.
     * @param yaddr yAddr值
     */
    public void setAddr(final int yaddr) {
        this.yAddr = yaddr;
    }
    
    public String getValueParam() {
        return this.valueParam;
    }
    
    public void setValueParam(final String valueParam) {
        this.valueParam = valueParam;
    }
    
    @Override
    public List<Map<String, Object>> getAttrValueMapList() {
        // TODO Auto-generated method stub
        return this.attrValueMapList;
    }
    
    @Override
    public void setAttrValueMapList(List<Map<String, Object>> attrValueMapList) {
        this.attrValueMapList = attrValueMapList;
        
    }
    
    /**
     * 是否必填.
     * 支持继承的关系上的配置，比如销售品、产品
     * 
     * @return boolean
     */
    public boolean isCantNull(){
        return this.cantNull;
    }
    
    /**
     * 是否必填.
     * 支持继承的关系上的配置，比如销售品、产品
     * 
     * @return boolean
     */
    public boolean isCantNull(Object entity){
        return this.isCantNull();
    }
    
    @Override
    public boolean isNeedCheckRight() {
        return false;
    }
}
